import { spawn } from "node:child_process";
process.env.PARENT_VAR="pppp"
let child = spawn(process.execPath, ["../child/dist/index.js"],{ stdio: "inherit" ,detached : true})
child.on("exit",()=>{
    console.log("child exit")
})
// stdout
child.stdout?.on("data", (data) => {
    console.log(`stdout: ${data}`);
});
// stderr
child.stderr?.on("data", (data) => {
    console.error(`stderr: ${data}`);
});
child.unref()